﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using BLL;
namespace WebApplication2
{
    public partial class addteacher : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btn_add_Click(object sender, EventArgs e)
        {
            teacher Teacher = new teacher();
            Teacher.tno = Convert.ToInt32(this.tb_tno.Text);
            Teacher.password = this.tb_pwd.Text;
            Teacher.tname = this.tb_tname.Text;
            Teacher.Sex = this.rb_sex.SelectedValue;
            int num = teacherinfoBLL.Add(Teacher);
            if (num > 0)
            {
                Response.Redirect("teacherinfo.aspx");
            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");
            }
        }
    }
}